<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="main :: common_head">
    <style>
        ul li {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        #myli > ul:hover::before {
            display: none;
        }
    </style>
</head>

<body>

<div class="container-fluid-full">
    <div class="row-fluid">
        <noscript>
            <div class="alert alert-block span10">
                <h4 class="alert-heading">Warning!</h4>
                <p>You need to have <a href="" target="_blank">JavaScript</a> enabled to use this site.</p>
            </div>
        </noscript>

        <!-- start: Content -->
        <div id="content" class="span10" style="width: 100%;">
            <ul class="breadcrumb" th:if="${#request.getParameter('breadcrumb') == 'true'}">
                <li>
                    <i class="fas fa-circle-notch"></i>
                    <a id="home" href="#" onclick="parent.location.reload()">主页</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">图谱切换历史</a></li>
            </ul>
            <div class="row-fluid sortable">
                <div class="box span12" >
                    <div class="box-header" data-original-title>
                        <h2><i class="halflings-icon white user"></i><span class="break"></span>图谱切换历史</h2>
                        <div class="box-icon"></div>
                    </div>
                    <div class="box-content" >
                        <!--点位列表开始-->
                        <table class="table table-striped table-bordered bootstrap-datatable datatable" >
                            <thead>
                            <tr>
                                <th>上次使用的图谱id</th>
                                <th>上次使用的图谱名称</th>
                                <th>当前使用的图谱id</th>
                                <th>当前使用的图谱名称</th>
                                <th>切换时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="graphChangeLog:${graphChangeLogList}">
                                <td th:text="${graphChangeLog.lastGraphId}"></td>
                                <td class="center" th:text="${graphChangeLog.lastGraphName}"></td>
                                <td class="center" th:text="${graphChangeLog.curGraphId}"></td>
                                <td class="center" th:text="${graphChangeLog.curGraphName}"></td>
                                <td class="center" th:text="${graphChangeLog.updateTime}"></td>
                                <td class="center">
<!--                                    <a class="btn btn-success" title="查看"-->
<!--                                       th:href="@{/graphChangeLog/getInfo/}+${graphChangeLog.id}">-->
<!--                                        查看-->
<!--                                    </a>-->
<!--                                    <a class="btn btn-info" title="修改"-->
<!--                                       th:href="@{/graphChangeLog/update/}+${graphChangeLog.id}">-->
<!--                                        修改-->
<!--                                    </a>-->
                                    <a class="btn btn-danger" href="#" title="删除" th:id="${graphChangeLog.id}" onclick="deleteRecord(this.id)">删除</a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <!--点位列表结束-->
                    </div>
                </div>
            </div>
        </div><!--/.fluid-container-->
        <!-- end: Content -->
    </div><!--/#content.span10-->
</div><!--/fluid-row-->

<div class="modal hide fade" id="myModal">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h3>Settings</h3>
    </div>
    <div class="modal-body">
        <p>Here settings can be configured...</p>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Close</a>
        <a href="#" class="btn btn-primary">Save changes</a>
    </div>
</div>
<div class="common-modal modal fade" id="common-Modal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-content">
        <ul class="list-inline item-details">
            <li><a href="http://sc.chinaz.com">Admin templates</a></li>
            <li><a href="http://sc.chinaz.com">Bootstrap themes</a></li>
        </ul>
    </div>
</div>
<div class="clearfix"></div>

<div th:replace="main::common_js"></div>

<script th:inline="javascript">
    breadcrumb()
    window.onload = function() {
        parent.modifyTitle("图谱切换历史记录")
    }
    function deleteRecord(id) {
        console.log("id:",id);
        window.layerAlert("你确定要删除该记录吗?",{
            icon:3,
            title: "提示",
            btn:["确定","取消"],
            yes:function () {
                $.ajax({
                    type: "GET",
                    url: "/multipower/graphChangeLog/deleteById",
                    data: {id: id},
                    success: function () {
                        window.layerAlert("删除成功", {
                            icon: 6,
                            title: "提示",
                            yes:function (){
                                window.location.href = "/multipower/knowChartChangeHistory.html";
                            }
                        });
                    },
                    error:function () {
                        window.layerAlert("删除失败", {
                            icon: 5,
                            title: "提示"
                        });
                    }
                })
            }
        })
    }
</script>

<script th:src="@{/js/detect-element-resize.js}"></script>
<script th:src="@{/js/iframe-resize.js}"></script>

<script>
    //获取当前点击的点位菜单，添加高亮显示
    $(document).ready(function () {
        var location = window.location.href;//获取url
        var id = location.substring(location.lastIndexOf('/') + 1);
        if (id.lastIndexOf('?') != -1) {
            id = id.substring(0, id.lastIndexOf('?'))
        }
        $("#" + "li" + id).addClass("active").siblings().removeClass("active");//给对应的li高亮


    })
</script>
</body>
</html>
